package top.soulblack.purchasesale.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import top.soulblack.purchasesale.model.GoodsSeason;

import java.util.List;

/**
 * create by 小川
 */
@Mapper
public interface GoodsSeasonMapper {

    int deleteById(Integer id);

    int insert(GoodsSeason record);

    int insertSelective(GoodsSeason record);

    GoodsSeason selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(GoodsSeason record);

    int updateByPrimaryKey(GoodsSeason record);

    @Select("select * from goods_season")
    List<GoodsSeason> selectAll();

    @Insert("insert into goods_season (name,`remark`, create_time) values (#{name}, #{remark}, #{createTime})")
    void addSeason(GoodsSeason goodsSeason);

    @Select("select count(*) from goods_season where name = #{name}")
    int existSeason(String name);
}
